<!--
* 方法:Role.vue
* 描述:权限管理
* 作者:Jimmy
* 日期:2018-08-06
*/
-->
<template>
  <div>
    <RoleList v-show="list" @toggle="show"></RoleList>
    <RoleInfo v-show="info" @toggle="show" v-bind:data="data" v-if="info"></RoleInfo>
  </div>
</template>
<script>
import RoleList from './components/Role-list.vue'
import RoleInfo from './components/Role-info.vue'
export default {
  components: {
    RoleList,
    RoleInfo
  },
  data () {
    return {
      list: true,
      info: false,
      data: ''
    }
  },
  methods: {
    show (data) {
      if (data.type === 'list') {
        this.list = true
        this.info = false
      } else {
        this.$nextTick()
        this.list = false
        this.info = true
        this.data = data
      }
    }
  }
}
</script>
